package com.sharing.library.repository.spec;

import com.sharing.library.entity.Book;
import com.sharing.library.repository.dto.BookCondition;
import com.zhx.framework.util.support.ImoocSpecification;
import com.zhx.framework.util.support.QueryWraper;

/**
 * @author zhanghaixuan
 * @create 2018/3/19-下午2:45
 **/
public class BookSpec extends ImoocSpecification<Book, BookCondition> {

    public BookSpec(BookCondition condition) {
        super(condition);
    }

    @Override
    protected void addCondition(QueryWraper<Book> queryWraper) {
        addLikeCondition(queryWraper, "bookname");
        addLikeCondition(queryWraper,"isbn");
        addLikeCondition(queryWraper,"author");
        addEqualsCondition(queryWraper,"typeId");
        addEqualsCondition(queryWraper,"state");
        addEqualsCondition(queryWraper,"submitUserId");
    }

}
